package group2assignone.func;

import java.awt.Checkbox;
import java.awt.CheckboxGroup;

/**
 * Class to use assign an index number
 * to checkboxes contained within a CheckboxGroup
 * @author group2
 */
public class MyCheckBox extends Checkbox {

    private int index;

    /**
     * initialises the check box and it's index
     * @param label
     * @param state
     * @param group
     * @param num
     */
    public MyCheckBox(String label, boolean state, CheckboxGroup group, int num) {
        super(label, state, group);
        this.index = num;
    }

    /**
     * returns the index of the check box
     * @return index
     */
    public int getIndex() {
        return index;
    }

    /**
     * sets the index of the check box
     * @param num
     */
    public void setIndex(int num) {
        this.index = num;
    }
}
